package ru.msu.cmc.sp.oberon2.exceptions;

import ru.msu.cmc.sp.oberon2.Oberon2;

public class BaseException extends RuntimeException {
	
	@Deprecated
	public BaseException() {
		
	}
	@Deprecated
	public BaseException(int _line, int _pos, String _ident) {
		line = _line;
		charPositionInLine = _pos;
		ident = _ident;
	}
	
	public void print() {
		if (line != 0) {
			line -= Oberon2.imported_lines - 1;
			System.err.println(Oberon2.filename + ":" + line + ":" + charPositionInLine + ":" + ident);
		} else {
			System.err.println(Oberon2.filename + ":" + ident);
		}
	}

	public int line;
	public int charPositionInLine;
	public String ident;
}
